package com.mysteel.cyx.demo.biz.export;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.data.WriteCellData;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class WarnOperationEnumConverter implements Converter<Integer> {

    @Override
    public Class<Integer> supportJavaTypeKey() {
        return Integer.class;
    }


    @Override
    public WriteCellData<?> convertToExcelData(Integer warnOperation, ExcelContentProperty contentProperty, GlobalConfiguration globalConfiguration) {
        if (warnOperation == null) {
            return new WriteCellData<>("");
        }
        return new WriteCellData<>(WarnOperationEnum.fromWarnOperation(warnOperation).getWarnOperationDesc());
    }


}